package algorithms.que13;

import edu.princeton.cs.algs4.In;
import edu.princeton.cs.algs4.Queue;

/**
 * @功能
 * @创建时间 2020/7/8
 */
public class ReadDate {
    public static void main(String[] args) {
        String[] a = readDate("www");
        for(int i=0;i<a.length;i++)
        System.out.println(a[i]);
    }
    public static String[] readDate(String name){
        In in = new In(name);
        Queue<String> q = new Queue<>();
      //  System.out.println(in.readAll());
        while (!in.isEmpty()){
            String w = in.readString();
            if(!w.equals("/"))
            q.enqueue(w);}
        int n = q.size();
        String[] a = new String[n];
        for(int i=0;i<n;i++){
            a[i] = q.dequeue();
        }
        return a;

    }
}
